<template>
	<view>
		<view class="top">
			<image class="ima" :src="avatarUrl" style="width: 130rpx;height: 130rpx;border-radius: 50%;"></image>
			<view class="mz" v-text="associationDetail.name">贵州民族大学校友会</view>
			<view class="zy" v-text="formatDate(associationDetail.createTime)"></view>
		</view>
		<view class="mid">
			<view class="wz">组织介绍: </view>
			<view class="nr" v-text="associationDetail.brief">这是扩建计划参加补考查明事实你卡上数据库，是u还能，生锈的文化，或许我，五月天台湾与，所以她去演。阿瓦达飒勇士，杰斯我的感觉。</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				associationDetail: {}, //校友会详情信息
				associationId: '', //校友会id
				avatarUrl: ''
			}
		},
		onLoad(option) {
			let that = this;
			that.avatarUrl = option.avatarUrl;
			that.associationId = option.id;
			uni.request({
					url: getApp().globalData.URL + 'association/queryAssociationById?id=' + this.associationId,
					method: 'GET'
				})
				.then(data => { //data为一个数组，数组第一项为错误信息，第二项为返回数据
					var [error, res] = data;
					console.log("成功连接!!");
					console.log(res.data);
					this.associationDetail = res.data;
				})
		},
		methods: {
			//日期转换方法
			formatDate(value) {
				let date = new Date(value);
				let y = date.getFullYear();
				let MM = date.getMonth() + 1;
				MM = MM < 10 ? ('0' + MM) : MM;
				let d = date.getDate();
				d = d < 10 ? ('0' + d) : d;
				// let h = date.getHours();
				// h = h < 10 ? (‘0’ + h) : h;
				// let m = date.getMinutes();
				// m = m < 10 ? (‘0’ + m) : m;
				// let s = date.getSeconds();
				// s = s < 10 ? (‘0’ + s) : s;
				// return y + ‘-’ + MM + ‘-’ + d + ’ ’ + h + ‘:’ + m + ‘:’ + s;
				return y + '年' + MM + '月' + d + '日';
			}
		}
	}
</script>

<style>
	.top {
		border-bottom: 1rpx solid #C0C0C0;
		height: 160rpx;
	}

	.ima {
		margin-top: 10rpx;
		margin-left: 15rpx;
	}

	.mz {
		font-size: 35rpx;
		margin-top: -120rpx;
		margin-left: 170rpx;
	}

	.zy {
		margin-left: 170rpx;
		font-size: 24rpx;
		margin-top: 10rpx;
		color: #999999;
	}

	.wz {
		font-size: 30rpx;
		margin-top: 20rpx;
		margin-left: 35rpx;
	}

	.nr {
		font-size: 25rpx;
		margin-right: 20rpx;
		color: #808080;
		width: auto;
		margin: 20rpx 40rpx 20rpx 50rpx;
	}
</style>
